package com.mock.Dao.impl;

import com.mock.entity.Person;
import com.mock.utils.DBU;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanListHandler;

import java.sql.SQLException;
import java.util.List;

public class BaseDao {
    private QueryRunner queryRunner = new QueryRunner();
    
    public <T> List<T> selectList(Class<T> clazz,String sql,Object...objs) throws SQLException {
        return queryRunner.query(DBU.getConnection(),sql,new BeanListHandler<>(clazz),objs);
    }
    
}
